﻿using PetaPoco;
using SellerCube.Service.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TestPetaPoco.Common
{
   public interface  IUserInfoService
    {
       PageTable PageTable(long pageIndex, long pageSize, List<ScriptSearch> scriptSearchs, string orderBy);

    }
    public class UserInfoService : BaseService<TestDAO>,IUserInfoService
    {
        public PageTable PageTable(long pageIndex, long pageSize, List<ScriptSearch> scriptSearchs, string orderBy)
        {
            var endDateSearch = scriptSearchs.FirstOrDefault(s => s.Column == "TakeDate" && s.Operate == OperateType.LessEq);
            if (endDateSearch != null)
            {
                endDateSearch.Value = endDateSearch.Value + " 23:59:59";
            }
            return Dao.PageTable(pageIndex, pageSize, scriptSearchs, orderBy);
        }

    }
}